home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / apmd.postinst < prev    next >
Encoding:
Text File  |  2009-02-26  |  1.5 KB  |  66 lines

  1. #!/bin/sh
  2. #
  3. # This is the postinst script for the Debian GNU/Linux apmd package
  4. #
  5. # Written by Dirk Eddelbuettel <edd@debian.org>
  6. # Debconf changes added by Chris Hanson <cph@debian.org>
  7.  
  8. set -e 
  9. umask 022
  10.  
  11. # Remove a no-longer used conffile
  12. rm_conffile()
  13. {
  14.     CONFFILE="$1"
  15.  
  16.     if [ -e "$CONFFILE".dpkg-obsolete ]; then
  17.         echo "Removing obsolete conffile $CONFFILE"
  18.         rm -f "$CONFFILE".dpkg-obsolete
  19.     fi
  20. }
  21.  
  22. case "${1}" in
  23. (configure)
  24.     . /usr/share/debconf/confmodule || exit 0
  25.  
  26.     db_stop
  27.  
  28.     # Upgrade from intrepid
  29.     if dpkg --compare-versions "$2" lt "3.2.2-12ubuntu2"; then
  30.     rm_conffile /etc/apm/scripts.d/hwclock
  31.     rm -f /etc/apm/suspend.d/99hwclock
  32.     rm -f /etc/apm/resume.d/00hwclock
  33.     fi
  34.  
  35.     # Remove shutdown and reboot links; this init script does not need them.
  36.     if dpkg --compare-versions "$2" lt "3.2.2-7ubuntu1"; then
  37.     rm -f /etc/rc0.d/K20apmd /etc/rc6.d/K20apmd
  38.     fi
  39.  
  40.     # Update init scripts links
  41.     if dpkg --compare-versions "$2" lt "3.2.2-12ubuntu3"; then
  42.     update-rc.d -f apmd remove
  43.     fi
  44.     ;;
  45. (abort-upgrade|abort-remove|abort-deconfigure)
  46.     ;;
  47. (*)
  48.     echo "postinst called with unknown argument \`$1'" >&2
  49.     exit 1
  50.     ;;
  51. esac
  52.  
  53. # Automatically added by dh_installinit
  54. if [ -x "/etc/init.d/apmd" ]; then
  55.     update-rc.d apmd start 10 2 3 4 5 . stop 21 1 . >/dev/null
  56.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  57.         invoke-rc.d apmd start || exit $?
  58.     else
  59.         /etc/init.d/apmd start || exit $?
  60.     fi
  61. fi
  62. # End automatically added section
  63.  
  64.  
  65. exit 0
  66.